Declare @SQL nvarchar(2000);
set @SQL = 'Alter table '+'?'+ ' rebuild PARTITION=ALL with (Data_COMPRESSION = PAGE);'
exec sp_MSForEachTable @SQL
